﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TexasHoldem.RankedHands
{
    public class StraightHand: RankedHand
    {
        private StraightHand(Hand hand) : base(hand) { }
        public static StraightHand TryCreateFrom(Hand hand)
        {
            return FindStraight(hand.Cards) != null ? new StraightHand(hand) : null;
        }

        public override string RankName
        {
            get { return "Straight"; }
        }

        protected override ushort RankingStrength
        {
            get { return 4; }
        }

        protected override IEnumerable<Card> FindDefiningCards()
        {
            return FindStraight(Cards);
        }
        static IEnumerable<Card> FindStraight(IEnumerable<Card> cards)
        {
            return new StraightFindingStrategy().FindStraight(cards);
        }

    }
}
